#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QApplication>
#include <QMainWindow>
#include <QPushButton>
#include <QFormLayout>
#include <QLineEdit>
#include <QTextEdit>
#include <QLabel>
#include <QHBoxLayout>
#include <QVBoxLayout>
#include <QDBusConnection>
#include <QDBusInterface>
#include <QDBusMessage>
#include <QDebug>
#include <QGSettings>
#include <DConfig>


const QString serviceServerName = "com.mytest.dbus";
const QString serviceServerPath = "/com/mytest/dbus";
const QString serviceServerInterface = "com.mytest.dbus.interface";
static Dtk::Core::DConfig *dConfig = Dtk::Core::DConfig::create("org.mytest","org.mytest.dconfig");

class MainWindow : public QMainWindow {
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    void setupDconfig();
    void setupUI();

public slots:
    void buttonClicked();
    void updateOutput();
    void updateSend();
private:
    bool outputVisual;
    bool sendVisual;
    QPushButton* send;
    QTextEdit* output;
    QLabel* name;
    QLabel* age;
    QLabel* phone;
    QLabel* cid;
    QLabel* home;
    QLabel* tem;
    QLineEdit* nameInput;
    QLineEdit* ageInput;
    QLineEdit* phoneInput;
    QLineEdit* cidInput;
    QLineEdit* homeInput;
    QLineEdit* temInput;
    QGSettings* gsettings;
    void saveGsettings();
};



#endif // MAINWINDOW_H
